/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package mvc;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author tadiwa
 */
@Entity
@Table(name = "uploads")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Uploads.findAll", query = "SELECT u FROM Uploads u"),
    @NamedQuery(name = "Uploads.findById", query = "SELECT u FROM Uploads u WHERE u.id = :id"),
    @NamedQuery(name = "Uploads.findByDocument", query = "SELECT u FROM Uploads u WHERE u.document = :document"),
    @NamedQuery(name = "Uploads.findByUploadedby", query = "SELECT u FROM Uploads u WHERE u.uploadedby = :uploadedby"),
    @NamedQuery(name = "Uploads.findByUploaddate", query = "SELECT u FROM Uploads u WHERE u.uploaddate = :uploaddate")})
public class Uploads implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 255)
    @Column(name = "document")
    private String document;
    @Size(max = 255)
    @Column(name = "uploadedby")
    private String uploadedby;
    @Column(name = "uploaddate")
    @Temporal(TemporalType.DATE)
    private Date uploaddate;

    public Uploads() {
    }

    public Uploads(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDocument() {
        return document;
    }

    public void setDocument(String document) {
        this.document = document;
    }

    public String getUploadedby() {
        return uploadedby;
    }

    public void setUploadedby(String uploadedby) {
        this.uploadedby = uploadedby;
    }

    public Date getUploaddate() {
        return uploaddate;
    }

    public void setUploaddate(Date uploaddate) {
        this.uploaddate = uploaddate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Uploads)) {
            return false;
        }
        Uploads other = (Uploads) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mvc.Uploads[ id=" + id + " ]";
    }
    
}
